package com.ydgk.test;

import java.util.Date;

public class MyDate {
    public static void main(String[] args) {
        Date d = new Date();

        int h = d.getHours();
        String s=null;
        if(h>=5&&h<8){
            s = "早上好！";
        }else if(h>=8&&h<11){
            s = "上午好！";
        }else if(h>=11&&h<13){
            s = "中午好！";
        }else if(h>=13&&h<18){
            s = "下午好！";
        }else if(h>=18||h<5){
            s = "晚上好！";
        }
        System.out.println(s);
    }
}
